package com.koron.tool.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.koron.bean.base.Response;
import com.koron.tool.bean.ToolUserFaceBean;
import com.koron.tool.bean.ToolUserFaceQuery;
import com.koron.tool.mapper.ToolUserFaceMapper;
import com.koron.tool.service.ToolUserFaceService;
import lombok.extern.slf4j.Slf4j;
import org.koron.ebs.mybatis.SessionFactory;
import org.koron.ebs.mybatis.TaskAnnotation;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service
@Slf4j
public class ToolUserFaceServiceImpl implements ToolUserFaceService {
    @Override
    @TaskAnnotation("ToolUserFaceList")
    public Response ToolUserFaceList(SessionFactory factory, ToolUserFaceQuery query) {
        ToolUserFaceMapper mapper = factory.getMapper(ToolUserFaceMapper.class);
        PageHelper.startPage(query.getPage(), query.getPageSize());
        List<ToolUserFaceBean> list = mapper.ToolUserFaceList(query);
        PageInfo pageInfo = new PageInfo(list);
        return Response.succ(pageInfo);

    }

}